package controller;

import model.entity.Entity;
import model.entity.Mount;

public class DismountMediator {
    private Entity rider;
    private Mount mount;

    public DismountMediator(Entity e, Mount m) {
        rider = e;
        mount = m;

        KeyController.addDismount(new Dismount(this));
    }

    public void dismount() {
        rider.dismount();
        mount.dismountThis();
    }

    private class Dismount implements Command {
        private DismountMediator m;

        public Dismount(DismountMediator m) {
            this.m = m;
        }

        public void execute() {
            m.dismount();
        }
    }
}